package fhq.hcmute.edu.vn.util;

import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

public final class ProjectUtil {
	public static final String SECRECT_KEY = "hien098@X";
	public static final boolean YES = true;
	public static final boolean NO = false;
	public static final int AUTHENTICATION = 4;

	public static final int UPSERCASE = 1;
	public static final int LOWERCASE = -1;

	private ProjectUtil() {

	}

	public static String generateMD5Code(final String s) {
		try {
			MessageDigest m = MessageDigest.getInstance("MD5");
			m.update(s.getBytes(), 0, s.length());
			BigInteger i = new BigInteger(1, m.digest());
			return String.format("%1$032x", i);
		} catch (NoSuchAlgorithmException e) {
			e.printStackTrace();
		}
		return null;
	}

}
